<template>
  <div class="goods-hot">
    <h3>{{ hotTitle }}</h3>
    <!-- 商品区块 -->
    <nuxt-link v-for="item in hotList" :key="item.id" to="/" class="goods-item">
      <img :src="item.picture" alt="" />
      <p class="name ellipsis">{{ item.name }}</p>
      <p class="desc ellipsis">{{ item.desc }}</p>
      <p class="price">&yen;{{ item.price }}</p>
    </nuxt-link>
  </div>
</template>

<script>
export default {
  name: 'DetailHot',
  props: {
    hotType: {
      type: String,
      default: ''
    },
    hotList: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {}
  },
  computed: {
    hotTitle() {
      const map = {
        1: '24小时热销榜',
        2: '周热销榜'
      }
      return map[this.hotType] || ''
    }
  },
  mounted() {},
  methods: {}
}
</script>

<style scoped lang="scss">
.goods-hot {
  margin-top: 25px;
  h3 {
    height: 70px;
    background: $helpColor;
    color: #fff;
    font-size: 18px;
    line-height: 70px;
    padding-left: 25px;
    margin-bottom: 10px;
    font-weight: normal;
  }

  .goods-item {
    display: block;
    padding: 20px 30px;
    text-align: center;
    background: #fff;

    img {
      width: 160px;
      height: 160px;
    }

    p {
      padding-top: 10px;
    }

    .name {
      font-size: 16px;
    }

    .desc {
      color: #999;
      height: 29px;
    }

    .price {
      color: $priceColor;
      font-size: 20px;
    }
  }
}
</style>
